<?php

namespace common\helps;

use app\models\ArcClassify;
use app\models\ArcProgress;
use app\models\ArcTrain;
use yii\db\ActiveQuery;

class ClassifySearch
{
    /**
     * @param $id arc_classify表的id
     */
	public function search_classify($id,$arc_language){
        //得到arc_classify表的content
        $res = ArcClassify::findOne($id)->content;
        $array = explode('|',$res);
        $array=array_filter($array);
        $jsonArray = Tools::recogniseBaiduToHtml($array,$arc_language);
        //拆分$res;
        //循环查看是否有问题
        $pro = 0;
        foreach ($jsonArray as $value) {
            if(strpos($value[0],'<a style="color: red">')!==false){
                $pro ++;
            }
        }
        if($pro>0){
//            echo '有问题<br>';
            return 1;
        }else{
            //echo '正常';
            return 2;
        }
	}   
}
